import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    id: root

    property alias title: title.text
    property alias toolBarLayout: root.tools
    property alias headerHeight: titleBar.height
    property int footerHeight: 0
    property alias loading: busy.running
    property Item editArea: editArea
    signal clicked()
    Rectangle {
        id: titleBar
        anchors { top: parent.top; left: parent.left; right: parent.right }
        height: root.width < root.height ? 72 : 46
        color: 'red'

        Label {
            id: title
            anchors.left: parent.left
            anchors.verticalCenter: parent.verticalCenter
            anchors.margins: 10
            text: 'ATND'
            elide: Text.ElideRight
            platformStyle: LabelStyle { fontPixelSize: constants.fontLargeSize; textColor: 'white' }
            font.bold: true
        }
        Item {
            id: editArea
            anchors.left: title.right
            anchors.top: parent.top
            anchors.right: parent.right
            anchors.rightMargin: 10
            anchors.bottom: parent.bottom
        }

        BusyIndicator {
            id: busy
            anchors.verticalCenter: parent.verticalCenter
            anchors.right: parent.right
            anchors.margins: 10
            visible: running
            style: BusyIndicatorStyle { inverted: true }
        }

        MouseArea { anchors.fill: parent; onClicked: root.clicked() }
    }

}
